home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 August (Alt) / CHIP 2005-08.1.iso / program / guvenlik / syslinux-3.07.exe / sample / atou.c next >
Encoding:
C/C++ Source or Header  |  2003-12-10  |  199 b   |  15 lines

  1. static inline int
  2. isdigit(int ch)
  3. {
  4.   return (ch >= '0') && (ch <= '9');
  5. }
  6.  
  7. unsigned int atou(const char *s)
  8. {
  9.   unsigned int i = 0;
  10.   while (isdigit(*s))
  11.     i = i*10 + (*s++ - '0');
  12.   return i;
  13. }
  14.  
  15.